import { useWorkTime } from '../../contexts/WorkTimeContext'
import CalendarExport from '../../components/CalendarExport'

const DataExportSection = () => {
  const { workTimeData, filteredData } = useWorkTime()

  return (
    <div className='section-card' style={{ height: '100%' }}>
      <h2 className='section-title'>数据导出</h2>
      {workTimeData.length > 0 ? (
        <CalendarExport data={filteredData} />
      ) : (
        <div
          style={{
            textAlign: 'center',
            color: '#999',
            padding: '40px 0',
          }}
        >
          暂无数据，请先导入Excel文件
        </div>
      )}
    </div>
  )
}

export default DataExportSection
